import { createApp,getCurrentInstance,provide } from 'vue'
// import axios from './util/axios.js'
// import {load} from './config/apiLoader.js'
import {baseComponentPlugin} from '../src/components/base/index.js'
import {businessComponentPlugin} from '../src/components/business/index.js'
import {apiLoader} from './config/apiLoadPlugin.js'
import {MyRouter,myExportTest} from './router/index.js'
import App from './App.vue'
import { createPinia } from 'pinia'
import 'virtual:uno.css'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus'
import 'normalize.css/normalize.css'
import Message from '../src/plugn/Message.js'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

let app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// app.config.globalProperties.$api = axios
// app.use(await load(app))
// await load(app)
app.use(MyRouter)
app.use(ElementPlus)
app.use(baseComponentPlugin)
app.use(businessComponentPlugin)
app.use(apiLoader)
app.use(createPinia())
app.provide('message',Message)
app.mount('#app')
